﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2021_5_24
{
    #region 移动储存父类
    class MobileStorage:IUSB
    {
        private string band;
        private string type;

        public string Band { get => band; set => band = value; }
        public string Type { get => type; set => type = value; }

        public MobileStorage(string band, string type)
        {
            this.Band = band;
            this.Type = type;
        }

        public void Read()
        {
            Console.WriteLine("{0} {1}正在读取数据中...",this.band,this.type);
        }
        public void Write()
        {
            Console.WriteLine("{0} {1}正在写入数据中...", this.band, this.type);
        }

    }

    #endregion

    #region 移动硬盘类
    class MobileHDD : MobileStorage, IUSB
    {
        public MobileHDD(string band, string type) : base(band, type)
        { }
    }
    #endregion

    #region U盘
    class USB : MobileStorage
    {
        public USB(string band, string type) : base(band, type)
        { }
    }
    #endregion

    #region 计算机类
    class Computer : IUSB
    {
        public MobileStorage usb1;
        public MobileStorage usb2;
        public void Read()
        {
            Console.WriteLine("{0} {1}正在读取数据中", usb1.Band, usb1.Type);
            Console.WriteLine("{0} {1}正在读取数据中", usb2.Band, usb2.Type);
        }

        public void Write()
        {
            Console.WriteLine("{0} {1}正在写入数据中", usb1.Band, usb1.Type);
            Console.WriteLine("{0} {1}正在写入数据中", usb2.Band, usb2.Type);
        }
    }
    #endregion
}
